package com.haojiang.mh.remote.ui.activity;

import android.view.View
import androidx.core.view.ViewCompat
import androidx.core.view.ViewPropertyAnimatorListener
import com.haojiang.mh.R
import com.haojiang.mh.remote.base.BaseActivity
import com.haojiang.mh.remote.utils.Util
import kotlinx.android.synthetic.main.activity_splash_richmat.*

class SplashActivity : BaseActivity(), ViewPropertyAnimatorListener {

    override fun getLayoutId(): Int {
//        when (Util.getPackageName()) {
//            "com.richmat.poshlavish" -> {
//                return R.layout.activity_splash_poshlavish
//            }
//        }
        return R.layout.activity_splash_richmat
    }

    override fun initData() {
//        if(Util.getPackageName().equals("com.richmat.richmat")) {
        ViewCompat.animate(ivSplash).scaleX(1.0f).scaleY(1.0f).setListener(this).setDuration(1500)
//        }
    }

    override fun onAnimationEnd(view: View?) {
        //防止重重复启动Launcher
        if (!isTaskRoot) {
            isInterruptProcess = true
            finish()
            return
        }
//        startActivityAndFinish<MainActivity>()
    }

    override fun onAnimationCancel(view: View?) {
    }

    override fun onAnimationStart(view: View?) {
    }
}